function request (path, callback) {
  return [path, function handler (req, res, next) {
    callback(req, res).then(data => res.json({ code: 200, success: true, data })).catch(e => next(e))
  }]
}

module.exports = {
  request
}
